package com.zmzncs.lmtc.module.shop.service.impl;

import com.zmzncs.lmtc.common.util.DateTimeUtil;
import com.zmzncs.lmtc.module.shop.dao.ShopGoodsMapper;
import com.zmzncs.lmtc.module.shop.dao.ShopGoodsSlideShowDao;
import com.zmzncs.lmtc.module.shop.dao.ShopTicketMapper;
import com.zmzncs.lmtc.module.shop.pojo.shop_goods.ShopGoodsDTO;
import com.zmzncs.lmtc.module.shop.pojo.shop_goods_slide_show.ShopGoodsSlideShowDTO;
import com.zmzncs.lmtc.module.shop.pojo.shop_info.ShopInfo;
import com.zmzncs.lmtc.module.shop.dao.ShopInfoMapper;
import com.zmzncs.lmtc.module.shop.pojo.shop_info.ShopInfoDTO;
import com.zmzncs.lmtc.module.shop.pojo.shop_ticket.ShopTicketDTO;
import com.zmzncs.lmtc.module.shop.service.ShopInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商户-信息 服务实现类
 * </p>
 *
 * @author 高博文
 * @since 2021-05-20
 */
@Service
public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> implements ShopInfoService{

    @Autowired
    ShopInfoMapper shopInfoMapper;
    @Autowired
    ShopGoodsMapper shopGoodsMapper;
    @Autowired
    ShopTicketMapper shopTicketMapper;
    @Autowired
    ShopGoodsSlideShowDao shopGoodsSlideShowDao;


    @Override
    public List<ShopInfoDTO> getNearShopInfoList(String longitude, String latitude) {
        return shopInfoMapper.getNearShopInfo(longitude,latitude);
    }

    /**
     * 获取商户的商品列表
     */
    @Override
    public List<ShopGoodsDTO> getShopGoodsListByShopInfo(Long shopInfoId) {
        List<ShopGoodsDTO> shopGoodsDTOS =  shopGoodsMapper.getShopGoodsListByShopInfo(shopInfoId);
        return shopGoodsDTOS;
    }

    /**
     * 获取商户的优惠券列表
     *
     * @param shopInfoId
     * @return
     */
    @Override
    public List<ShopTicketDTO> getShopTicketListByShopInfo(Long shopInfoId) {
        List<ShopTicketDTO> shopGoodsDTOS =  shopGoodsMapper.getShopTicketListByShopInfo(shopInfoId);
        return shopGoodsDTOS;
    }

    /**
     * 获取附近 ， 商户的商品
     *
     * @param longitude
     * @param latitude
     * @return
     */
    @Override
    public List<ShopGoodsDTO> getNearShopGoodsList(String longitude, String latitude) {
        List<ShopGoodsDTO> shopGoodsDTOS =  shopGoodsMapper.getNearShopGoods(longitude,latitude);
        return shopGoodsDTOS;
    }


    /**
     * 获取附近 ， 商户的优惠券
     *
     * @param longitude
     * @param latitude
     * @return
     */
    @Override
    public List<ShopTicketDTO>  getNearShopTicketList(String longitude, String latitude) {
        List<ShopTicketDTO>  shopTicketDTOS = shopTicketMapper.getNearShopTicket(longitude,latitude);

        return shopTicketDTOS;
    }


    /**
     * 获取附近 ， 商户的轮播图
     *
     * @param longitude
     * @param latitude
     * @return
     */
    @Override
    public List<ShopGoodsSlideShowDTO> getNearShopGoodsSlideList(String longitude, String latitude) {
        List<ShopGoodsSlideShowDTO>  shopGoodsSlideShowDTOS =  shopGoodsSlideShowDao.getNearShopGoodsSlideShow(longitude,latitude);
        return shopGoodsSlideShowDTOS;
    }





}
